package com.jbp.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jbp.dao.LuckKeyRecordDao;
import com.jbp.model.LuckKeyRecord;
import com.jbp.service.LuckKeyRecordService;
import org.springframework.stereotype.Service;
import com.jbp.utils.PageUtils;
import com.jbp.utils.Query;
import java.util.Map;

/**
 * 钥匙变动记录(LuckKeyRecord)表服务实现类
 * @author cc
 * @since 2021-04-29 17:54:46
 */
@Service
public class LuckKeyRecordServiceImpl extends ServiceImpl<LuckKeyRecordDao, LuckKeyRecord> implements LuckKeyRecordService {
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        QueryWrapper<LuckKeyRecord> queryWrapper = new QueryWrapper<>();
        if (params.get("id") != null){
            queryWrapper.like("id",params.get("id"));
        }
        IPage<LuckKeyRecord> page = this.page(
                new Query<LuckKeyRecord>().getPage(params),
                queryWrapper
        );

        return new PageUtils(page);
    }
}